#ifndef WHCRC_H_
#define WHCRC_H_

namespace qb {
	class CCRC
	{
	public:
		enum CRCType
		{
			E_CRC8 = 0,
			E_CRC16 = 1,
			E_CRC16F = 2,
			E_CRC32 = 3
		};
	public:
		CCRC(CRCType etype);
		~CCRC();

	public:
		int CRCCheck(char* pcIn, int iLen, unsigned int* pulValue);
		//int CRCCheck(char *pcIn,int iLen,char *pcValue);
	private:
		CRCType m_eType;
		static unsigned int m_tlCRC32[];
	private:
		unsigned int UPDC32(unsigned int p, unsigned int crc);
	};

}
#endif
